﻿Public Class Login
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString("ReturnUrl"))
    End Sub

    Protected Sub submitButton_Loggedin(ByVal sender As Object, ByVal e As System.EventArgs) Handles LoginUser.LoggedIn
        If Roles.IsUserInRole("Administrator") Then
            Response.Redirect("/User_View/AdminView/AdminHome.aspx?=")
        ElseIf Roles.IsUserInRole("Instructor") Then
            Response.Redirect("/User_View/InstructorView/InstructorHome.aspx?=")
        ElseIf Roles.IsUserInRole("Employee") Then
            Response.Redirect("/User_View/EmployeeView/EmployeeHome.aspx?=")
        End If
    End Sub

End Class